<?php

namespace app\api\controller;

use app\common\controller\Api;

class Article extends Api
{
    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    /**
     * 获取文章详情
     *
     * @param int $id 文章ID
     * @throws \think\exception\DbException
     */
    public function detail($id)
    {
        $row = model('Article')->getDetail($id);
        if (!$row) {
            $this->error(__('No Results were found'));
        }

        $this->success('', $row);
    }
}